Preditor Changes

From PreyWiki

Overview of Changes

  • Added new navigation modes to the 3d/camera view (UnrealEd-Style and FPS-style). [details below]
  • Fixed import code (pasting, cloning, map import). Now properly handles all name collisions and adjusts references. [details below]
  • Added mouse-wheel zooming to the 3d/camera view.
  • Many additional commands can be bound to keyboard shortcuts. [details below]
  • Fixed and enhanced select all. Now 2 key bindings, select all-of-type (shift-a) and select filtered entities (shift-z). Many filter types are available for entity selection. [details below]
  • Fixed alt-shift select bug (pressing and releasing alt would interrupt the shift-select).
  • Fixed Selection→Select→All Targets to properly update the views.
  • Added Selection→Connect Reverse. It connects entities in reverse (the last selected entity will target all the other selected entities).
  • Fixed group selections (Select Complete Tall, etc.) to correctly build the selection order array. This is useful with the new Selection→Connect Reverse (for example, do a group select operation, then select the entity you want to target the entire group, then do a Selection→Connect Reverse).
  • Fixed ctrl-arrow texture scaling.
  • Added _ShowGameSetViewPos command (not bound by default), which automatically puts the player at the editor's camera location before switching to the game window.
  • Added "invert hidden" feature, as menu View→Hide/Show→Invert Hidden (shift-v).
  • Navigation mode features added:
    • Teleport function. Instantly move close to the object the camera is pointing at. [details below]
    • Quick select (left mouse button will select while nav-mode is active).
    • Target lock. Focus the camera on an object and rotate about it. [details below]
    • Camera view information displays. Quickly show information in the camera view about the entity or material that you're pointing at. [details below]
    • Mouse-controlled texture adjustment (position, scale, rotation). [details below]
  • Added the option for caps lock to scale the movement speed (normal step-based movement as well as the new navigation mode). [details below]

Binding Commands To Keyboard Shortcuts

Many new commands have been added to the list of commands that can be bound to shortcut keys. Using the menu Help→Command List will show a list of available commands. The first column is the command name; the second column is the current shortcut binding (or blank if the command is not bound). To change the key shortcuts for Preditor, create a file called "radiant.ini" and put it in the same directory as Prey.exe. Here's an example file:

; Example radiant.ini
[Commands]
show_togglepath=t+shift+ctrl
selection_selectcompletetall=w+shift
bsp_command3=b+shift
_showgamesetviewpos=f12

Comment lines start with a semicolon. All key bindings go under the [Commands] heading. Type the name of the command, followed by an equal sign, followed by the key, followed by optional +alt, +ctrl, and +shift. All text is case insensitive. You will need to shut down and restart the editor for the changes in radiant.ini to take effect.

Special Key Names:

Space, Backspace, Escape, End, Insert, Delete, PageUp, PageDown, Up, Down, Left, Right, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, Tab, Return, Comma, Period, Plus, Multiply, Subtract, NumPad0, NumPad1, NumPad2, NumPad3, NumPad4, NumPad5, NumPad6, NumPad7, NumPad8, NumPad9.

New Navigation Mode Added to Camera View

The editor now has UnrealEd-style and FPS-style navigation in the 3d/camera view. By default, it is disabled and the original behavior is used. To enable and configure the new navigation mode, add the following section to radiant.ini:

[3d navigation]
style=2
forward=w
back=s
up=space
down=shift
left=a
right=d
modifier1=q
modifier2=e
invertpitch=0
invertztrans=0
capslockscale=5
reticlemode=1
reticlescale=1
reticlecolor=251, 199, 30

Click and hold the right mouse button to activate "Navigation Mode." You will remain in this mode until the right mouse button is released. While in this mode, you will be able to look around with the mouse. The movement keys defined in radiant.ini will override their normal editor functions, and you will be able to move through the map just like in noclip mode. All other keys will behave as normal. Set the slow/fast slider under preferences to adjust the movement speed.

  • style:
    • 1: Old navigation behavior.
    • 2: New UnrealEd-style/FPS-style.
    • Default: 1
  • forward, back, up, down, left, right:
    • Bind these to your preferred FPS movement keys.
  • modifier1, modifier2:
    • These keys are used to implement the UnrealEd-style navigation:
      • When modifier1 is pressed: vert axis = move up/down, horz axis = move left/right.
      • When modifier2 is pressed: vert axis = move forward/back, horz axis = look left/right.
  • invertpitch:
    • Set to 1 to invert the mouselook up/down.
    • Default: 0
  • invertztrans:
    • Set to 1 to invert the move up/down behavior when "modifier1" is pressed.
    • Default: 0
  • capslockscale:
    • The movement speed is multiplied by this number when caps lock is on (this also affects the normal step-based movement).
    • Default: 1.0
  • reticlemode:
    • 0: Off.
    • 1: Only on while in navigation mode.
    • 2: Always on.
    • Default: 0
  • reticlescale:
    • This number determines the size of the reticle.
    • Default: 1.0
  • reticlecolor:
    • Set the reticle color. R, G and B values can be separated by commas or spaces.
    • Default: “50 230 50” (green)

Editor fix for import/paste/clone

All references to renamed entities are now linked up correctly after a paste, import or clone operation. All keys are tested for each entity, so for large imports this operation can take a while. The editor will print the renamed entity names to the console, in case they’re needed for script fix-ups or any other purpose. It also shows the number of adjusted references.


Select All and Select Filtered Entities

The editor's select-all function has been fixed and enhanced. It's now split into two key bindings, shift-a and shift-z, as described below:

Basic select all-of-type (shift-a):

  • If an entity is selected, all entities of its class will be selected.
  • If worldspawn is selected, all worldspawn brushes will be selected.
  • If a face is selected, all brushes that contain the material of that face will be selected.
  • If nothing is selected, all brushes that contain the material from the media/texture inspector will be selected.

Filtered entity select (shift-z):

This will select entities using a filter described by the Key/Val fields of the entity inspector. For example, to select all monster_hunters that have attack_path set to 1, just select a monster_hunter and make sure "attack_path" is in the Key field and "1" is in the Val field, then press shift-z. If nothing is selected when shift-z is pressed, it will apply the filter to all entities, rather than narrowing it to a particular class. Here's the full list of filter types:

  • EQUAL TO: selects entities that have a matching Key and Val, as described above.
  • NOT EQUAL TO: Val = "/val" - selects entities that have a matching Key, but the Val is different.
  • HAS KEY: leave the Val field empty - selects entities that have a matching Key, regardless of Val.
  • DOES NOT HAVE KEY: Key = "/key" - selects entities that do not have a matching Key.
  • LESS THAN: Val = "<val" - selects entities that have a matching Key with Val less than specified float.
  • GREATER THAN: Val = ">val" - selects entities that have a matching Key with Val greater than specified float.
  • WITHIN RANGE: Val = "#val1,val2" - selects entities that have a matching Key with Val >= val1 and Val <= val2.
  • FIND STRING: Val = "*string" - selects entities that have a matching Key with "string" somewhere in the Val. It is case-sensitive by default, use "*~string" for case-insensitive.
  • MATCH PATTERN: Val = "$pattern" - selects entities that have a matching Key and with a Val that matches the specified pattern. Use "$~pattern" for case-insensitive. The pattern meta-characters are:
    • "?" matches any single character.
    • "*" matches any string of zero or more characters.
    • "[abc...]" match any of the enclosed characters; a hyphen can be used to specify a range (for example, a-z, A-Z, 0-9).


Extra Navigation Mode Features

All of these features are enabled by changing settings in the [3d navigation] section of the radiant.ini configuration file (as described above). Here’s a list of settings as they would be added to the radiant.ini file, followed by a description for each setting:

[3d navigation]
teleport=f
infodisplay=t
locktarget=r
invertlockpitch=0
invertlockyaw=0
texposition=z
texscale=x
texrotate=c
  • teleport:
    • Pressing this key will instantly move the camera close to the first object that is intersected by a forward trace line.
  • infodisplay:
    • Pressing this key cycles between entity display, material display and no display. Each of these displays is shown in the camera view and is based on the object the camera is pointing at. The display is updated as you move and look around, which is handy for rapidly scanning entities and materials. The entity display lists all key/value pairs, while the material display shows name, size, matter type, decl info, etc.
  • locktarget:
    • Press and hold this key and the camera will lock onto the first object that is intersected by a forward trace line. Mouse control will now rotate the view about the target. The forward and back keys (the ones assigned for navigation mode) will zoom in and out.
  • invertlockpitch:
    • For locktarget mode, set to 1 to invert the mouse control up/down.
    • Default: 0
  • invertlockyaw:
    • For locktarget mode, set to 1 to invert the mouse control left/right.
    • Default: 0